package com.example.compare;

public class User implements Comparable<User> {
	private Long id;
	private String name;
    private Long price;
    
	public Long getPrice() {
		return price;
	}


	public void setPrice(Long price) {
		this.price = price;
	}


	public Long getId() {
		return id;
	}


	public void setId(Long id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}

    
	
	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		
		if(this.getId()>o.getId()){
			return -1;//由高到低
		}else if(this.getId()<o.getId()){
			return 1;//
		}else{
			return 0;
		}
		
	}




	



}
